package com.geeksaga.message;

import java.util.ArrayList;
import java.util.List;

import com.geeksaga.common.util.EmailUtil;
import com.geeksaga.domain.User;

public abstract class GeekSagaMessage implements Message {
    public static final String SUBJECT_PREFIX = "[GeekSaga]";
    public static final String SENDER_EMAIL = "sns@geeksaga.com";
    
    protected List<User> userList;

    public GeekSagaMessage() {
    }
    
    public GeekSagaMessage(List<User> userList) {
        this.userList = userList;
    }

    public GeekSagaMessage(User user) {
        this.userList = new ArrayList<User>();
        this.userList.add(user);
    }
    
    public String getFrom() {
        return SENDER_EMAIL;
    }
    
    public String[] getReceivers() {
        return EmailUtil.extractMailAllowedEmailFrom(userList);
    }

    public boolean isHTML() {
        return true;
    }

    public abstract String getTitle();
    
    public abstract String getMessage();
}